package ${packageName}.controller;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import ${packageName}.service.${IServiceName};

<#if !entityName??>
import java.util.Map;
<#else>
import ${packageName}.entity.${entityName};
</#if>

<#if !entityName??>
@RestController
@CrossOrigin("*")
@RequestMapping("/${controllerPrefix}")
public class ${controllerName} extends BaseController {

	
	private ${IServiceName} service;

	@Autowired
	public ${controllerName}(${IServiceName} service) {
		super(service);
		this.service = service;
	}
		
	/**
	 * 导出excel
	 * 
	 * @return
	 */
	@RequestMapping("/exportExcel")
	public void exportExcel(@RequestParam Map<String, Object> paramMap, HttpServletResponse response) {
		service.exportExcel(paramMap, response);
	}
					
}
<#else>
@RestController
@CrossOrigin("*")
@RequestMapping("/${controllerPrefix}")
public class ${controllerName} extends BaseController<${entityName}> {


	private ${IServiceName} service;

	@Autowired
	public ${controllerName}(${IServiceName} service) {
		super(service);
		this.service = service;
	}

	/**
	 * 导出excel
	 *
	 * @return
	 */
	@RequestMapping("/exportExcel")
	public void exportExcel(${entityName} entity, HttpServletResponse response) {
		service.exportExcel(entity, response);
	}

}
</#if>